﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_QuyenNguoiSuDung : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("C1DockingTabPage3")]
        private C1DockingTabPage _C1DockingTabPage3;
        [AccessedThroughProperty("CKBaoCao")]
        private CheckBox _CKBaoCao;
        [AccessedThroughProperty("CKSua")]
        private CheckBox _CKSua;
        [AccessedThroughProperty("CKThem")]
        private CheckBox _CKThem;
        [AccessedThroughProperty("CKXem")]
        private CheckBox _CKXem;
        [AccessedThroughProperty("CKXoa")]
        private CheckBox _CKXoa;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("TxtNhom")]
        private TextBox _TxtNhom;
        [AccessedThroughProperty("TxtTenNhanVien")]
        private TextBox _TxtTenNhanVien;
        [AccessedThroughProperty("VSBaoCao")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSBaoCao;
        [AccessedThroughProperty("VSChucNang")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSChucNang;
        [AccessedThroughProperty("VSPhanHe")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSPhanHe;
        public string cFrmUserName;
        private IContainer components;
        private bool IsLoaded;
        private clsNguoiDung objNSD;

        public Frm_QuyenNguoiSuDung()
        {
            base.Load += new EventHandler(this.Frm_QuyenNguoiSuDung_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objNSD = new clsNguoiDung();
            this.IsLoaded = false;
            this.InitializeComponent();
        }

        private void CKBaoCao_Click(object sender, EventArgs e)
        {
            int num;
            if (this.CKBaoCao.Checked)
            {
                int num2 = this.VSBaoCao.Rows.Count - 1;
                for (num = 2; num <= num2; num++)
                {
                    this.VSBaoCao[num, 2] = 1;
                    this.SaveReportViewRight(num, 2);
                }
            }
            else
            {
                int num3 = this.VSBaoCao.Rows.Count - 1;
                for (num = 2; num <= num3; num++)
                {
                    this.VSBaoCao[num, 2] = 0;
                    this.SaveReportViewRight(num, 2);
                }
            }
        }

        private void CKSua_Click(object sender, EventArgs e)
        {
            int num;
            if (this.CKSua.Checked)
            {
                int num2 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num2; num++)
                {
                    this.VSChucNang[num, 4] = 1;
                    this.SaveRightPhatSinh(num, 4);
                }
            }
            else
            {
                int num3 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num3; num++)
                {
                    this.VSChucNang[num, 4] = 0;
                    this.SaveRightPhatSinh(num, 4);
                }
            }
        }

        private void CKThem_CheckedChanged(object sender, EventArgs e)
        {
            int num;
            if (this.CKThem.Checked)
            {
                int num2 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num2; num++)
                {
                    this.VSChucNang[num, 3] = 1;
                    this.SaveRightPhatSinh(num, 3);
                }
            }
            else
            {
                int num3 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num3; num++)
                {
                    this.VSChucNang[num, 3] = 0;
                    this.SaveRightPhatSinh(num, 3);
                }
            }
        }

        private void CKXem_Click(object sender, EventArgs e)
        {
            int num;
            if (this.CKXem.Checked)
            {
                int num2 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num2; num++)
                {
                    this.VSChucNang[num, 2] = 1;
                    this.SaveRightPhatSinh(num, 2);
                }
            }
            else
            {
                int num3 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num3; num++)
                {
                    this.VSChucNang[num, 2] = 0;
                    this.SaveRightPhatSinh(num, 2);
                }
            }
        }

        private void CKXoa_Click(object sender, EventArgs e)
        {
            int num;
            if (this.CKXoa.Checked)
            {
                int num2 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num2; num++)
                {
                    this.VSChucNang[num, 5] = 1;
                    this.SaveRightPhatSinh(num, 5);
                }
            }
            else
            {
                int num3 = this.VSChucNang.Rows.Count - 1;
                for (num = 2; num <= num3; num++)
                {
                    this.VSChucNang[num, 5] = 0;
                    this.SaveRightPhatSinh(num, 5);
                }
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_QuyenNguoiSuDung_Load(object sender, EventArgs e)
        {
            this.VSChucNang.AllowMerging = AllowMergingEnum.FixedOnly;
            this.VSChucNang.Cols[1].AllowMerging = true;
            //this.VSChucNang.GetCellRange(0, 1, 1, 1).Data = (object)modGeneral.Tranlated("Chức năng", "");
            this.VSBaoCao.AllowMerging = AllowMergingEnum.FixedOnly;
            this.VSBaoCao.Cols[1].AllowMerging = true;
            //this.VSBaoCao.GetCellRange(0, 1, 1, 1).Data = modGeneral.Tranlated("B\x00e1o c\x00e1o", "");
            this.VSChucNang.Rows.Count = 2;
            this.VSBaoCao.Rows.Count = 2;
            this.IsLoaded = false;
            this.LoadPhanHe();
            this.IsLoaded = true;
            this.LoadMenuRight();
            this.objNSD.Load(this.cFrmUserName);
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_QuyenNguoiSuDung));
            this.Panel1 = new Panel();
            this.TxtNhom = new TextBox();
            this.Label2 = new Label();
            this.TxtTenNhanVien = new TextBox();
            this.Label1 = new Label();
            this.CmdCancel = new Button();
            this.VSPhanHe = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.CKThem = new CheckBox();
            this.CKXem = new CheckBox();
            this.CKSua = new CheckBox();
            this.CKXoa = new CheckBox();
            this.VSChucNang = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.CKBaoCao = new CheckBox();
            this.VSBaoCao = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.C1DockingTabPage3 = new C1DockingTabPage();
            this.Panel1.SuspendLayout();
            this.VSPhanHe.BeginInit();
            this.VSChucNang.BeginInit();
            this.VSBaoCao.BeginInit();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            this.C1DockingTabPage3.SuspendLayout();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.TxtNhom);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.TxtTenNhanVien);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.CmdCancel);
            this.Panel1.Dock = DockStyle.Top;
            Point point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x2c7, 0x24);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0;
            point = new Point(0x155, 7);
            this.TxtNhom.Location = point;
            this.TxtNhom.Name = "TxtNhom";
            this.TxtNhom.ReadOnly = true;
            size = new Size(0xd1, 20);
            this.TxtNhom.Size = size;
            this.TxtNhom.TabIndex = 12;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(0x117, 10);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x23, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 11;
            this.Label2.Text = "Nh\x00f3m";
            point = new Point(0x4a, 7);
            this.TxtTenNhanVien.Location = point;
            this.TxtTenNhanVien.Name = "TxtTenNhanVien";
            this.TxtTenNhanVien.ReadOnly = true;
            size = new Size(0xc0, 20);
            this.TxtTenNhanVien.Size = size;
            this.TxtTenNhanVien.TabIndex = 10;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(12, 10);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x38, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 9;
            this.Label1.Text = "Nh\x00e2n vi\x00ean";
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x275, 4);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4c, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 8;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.VSPhanHe.AllowResizing = AllowResizingEnum.None;
            this.VSPhanHe.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSPhanHe.ColumnInfo = "2,0,0,0,0,85,Columns:0{Caption:\"MenuCode\";Visible:False;}\t1{Width:126;Caption:\"Ph\x00e2n hệ\";Style:\"DataType:System.String;TextAlign:LeftCenter;\";}\t";
            this.VSPhanHe.Dock = DockStyle.Fill;
            this.VSPhanHe.ExtendLastCol = true;
            this.VSPhanHe.FocusRect = FocusRectEnum.None;
            this.VSPhanHe.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0xa3);
            point = new Point(0, 0);
            this.VSPhanHe.Location = point;
            this.VSPhanHe.Name = "VSPhanHe";
            this.VSPhanHe.Rows.Count = 1;
            this.VSPhanHe.Rows.DefaultSize = 0x11;
            this.VSPhanHe.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0xce, 400);
            this.VSPhanHe.Size = size;
            this.VSPhanHe.StyleInfo = manager.GetString("VSPhanHe.StyleInfo");
            this.VSPhanHe.TabIndex = 0x15;
            this.VSPhanHe.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.CKThem.AutoSize = true;
            point = new Point(0x16d, 0x13);
            this.CKThem.Location = point;
            this.CKThem.Name = "CKThem";
            size = new Size(15, 14);
            this.CKThem.Size = size;
            this.CKThem.TabIndex = 0x17;
            this.CKThem.UseVisualStyleBackColor = true;
            this.CKXem.AutoSize = true;
            point = new Point(0x13a, 0x13);
            this.CKXem.Location = point;
            this.CKXem.Name = "CKXem";
            size = new Size(15, 14);
            this.CKXem.Size = size;
            this.CKXem.TabIndex = 0x16;
            this.CKXem.UseVisualStyleBackColor = true;
            this.CKSua.AutoSize = true;
            point = new Point(0x19e, 0x13);
            this.CKSua.Location = point;
            this.CKSua.Name = "CKSua";
            size = new Size(15, 14);
            this.CKSua.Size = size;
            this.CKSua.TabIndex = 20;
            this.CKSua.UseVisualStyleBackColor = true;
            this.CKXoa.AutoSize = true;
            point = new Point(0x1d2, 0x13);
            this.CKXoa.Location = point;
            this.CKXoa.Name = "CKXoa";
            size = new Size(15, 14);
            this.CKXoa.Size = size;
            this.CKXoa.TabIndex = 0x13;
            this.CKXoa.UseVisualStyleBackColor = true;
            this.VSChucNang.AllowResizing = AllowResizingEnum.None;
            this.VSChucNang.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSChucNang.ColumnInfo = manager.GetString("VSChucNang.ColumnInfo");
            this.VSChucNang.Dock = DockStyle.Fill;
            this.VSChucNang.ExtendLastCol = true;
            this.VSChucNang.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0xa3);
            point = new Point(0, 0);
            this.VSChucNang.Location = point;
            this.VSChucNang.Name = "VSChucNang";
            this.VSChucNang.Rows.Count = 0x17;
            this.VSChucNang.Rows.DefaultSize = 0x11;
            this.VSChucNang.Rows.Fixed = 2;
            size = new Size(0x1f5, 400);
            this.VSChucNang.Size = size;
            this.VSChucNang.StyleInfo = manager.GetString("VSChucNang.StyleInfo");
            this.VSChucNang.TabIndex = 0x12;
            this.VSChucNang.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.CKBaoCao.AutoSize = true;
            point = new Point(0x1d0, 0x13);
            this.CKBaoCao.Location = point;
            this.CKBaoCao.Name = "CKBaoCao";
            size = new Size(15, 14);
            this.CKBaoCao.Size = size;
            this.CKBaoCao.TabIndex = 20;
            this.CKBaoCao.UseVisualStyleBackColor = true;
            this.VSBaoCao.AllowResizing = AllowResizingEnum.None;
            this.VSBaoCao.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSBaoCao.ColumnInfo = manager.GetString("VSBaoCao.ColumnInfo");
            this.VSBaoCao.Dock = DockStyle.Fill;
            this.VSBaoCao.ExtendLastCol = true;
            this.VSBaoCao.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0xa3);
            point = new Point(0, 0);
            this.VSBaoCao.Location = point;
            this.VSBaoCao.Name = "VSBaoCao";
            this.VSBaoCao.Rows.Count = 0x17;
            this.VSBaoCao.Rows.DefaultSize = 0x11;
            this.VSBaoCao.Rows.Fixed = 2;
            size = new Size(0x1f5, 400);
            this.VSBaoCao.Size = size;
            this.VSBaoCao.StyleInfo = manager.GetString("VSBaoCao.StyleInfo");
            this.VSBaoCao.TabIndex = 0x13;
            this.VSBaoCao.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Dock = DockStyle.Left;
            point = new Point(0, 0x24);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            size = new Size(0xd0, 0x1aa);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 0x18;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.VSPhanHe);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0xce, 400);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Danh s\x00e1ch ph\x00e2n hệ";
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage2);
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage3);
            this.C1DockingTab2.Dock = DockStyle.Fill;
            point = new Point(0xd0, 0x24);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            size = new Size(0x1f7, 0x1aa);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 0x19;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.CKThem);
            this.C1DockingTabPage2.Controls.Add(this.CKXem);
            this.C1DockingTabPage2.Controls.Add(this.CKXoa);
            this.C1DockingTabPage2.Controls.Add(this.CKSua);
            this.C1DockingTabPage2.Controls.Add(this.VSChucNang);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x1f5, 400);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Ph\x00e1t sinh";
            this.C1DockingTabPage3.Controls.Add(this.CKBaoCao);
            this.C1DockingTabPage3.Controls.Add(this.VSBaoCao);
            this.C1DockingTabPage3.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage3.Location = point;
            this.C1DockingTabPage3.Name = "C1DockingTabPage3";
            size = new Size(0x1f5, 400);
            this.C1DockingTabPage3.Size = size;
            this.C1DockingTabPage3.TabIndex = 1;
            this.C1DockingTabPage3.Text = "B\x00e1o c\x00e1o";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x2c7, 0x1ce);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_QuyenNguoiSuDung";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "QUYEN SU DUNG";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSPhanHe.EndInit();
            this.VSChucNang.EndInit();
            this.VSBaoCao.EndInit();
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            this.C1DockingTabPage2.PerformLayout();
            this.C1DockingTabPage3.ResumeLayout(false);
            this.C1DockingTabPage3.PerformLayout();
            this.ResumeLayout(false);
        }

        public void LoadMenuRight()
        {
            if (((this.VSPhanHe.Rows.Count != 1) && (this.VSPhanHe.Row > 0)) && (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSPhanHe[this.VSPhanHe.Row, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
            {
                string pPhanHe = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSPhanHe[this.VSPhanHe.Row, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                int num = 0;
                DataTable menuRight = this.objNSD.GetMenuRight(modGeneral.MD5Encrypt(this.cFrmUserName), pPhanHe);
                if (menuRight != null)
                {
                    this.VSBaoCao.Rows.Count = 2;
                    this.VSChucNang.Rows.Count = 2;
                    this.CKXoa.Checked = false;
                    this.CKSua.Checked = false;
                    this.CKThem.Checked = false;
                    this.CKXem.Checked = false;
                    this.CKBaoCao.Checked = false;
                    int num2 = menuRight.Rows.Count - 1;
                    for (num = 0; num <= num2; num++)
                    {
                        if (menuRight.Rows[num]["ThuocTinh"].ToString().Trim() == "PS")
                        {
                            this.VSChucNang.AddItem("");
                            this.VSChucNang[this.VSChucNang.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(menuRight.Rows[num]["F002"]);
                            this.VSChucNang[this.VSChucNang.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(menuRight.Rows[num]["Ten"]);
                            if (menuRight.Rows[num]["F003"].ToString().Trim() == "0")
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 2] = 0;
                            }
                            else
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 2] = 1;
                            }
                            if (menuRight.Rows[num]["F004"].ToString().Trim() == "0")
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 3] = 0;
                            }
                            else
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 3] = 1;
                            }
                            if (menuRight.Rows[num]["F005"].ToString().Trim() == "0")
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 4] = 0;
                            }
                            else
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 4] = 1;
                            }
                            if (menuRight.Rows[num]["F006"].ToString().Trim() == "0")
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 5] = 0;
                            }
                            else
                            {
                                this.VSChucNang[this.VSChucNang.Rows.Count - 1, 5] = 1;
                            }
                        }
                        if (menuRight.Rows[num]["ThuocTinh"].ToString().Trim() == "BC")
                        {
                            this.VSBaoCao.AddItem("");
                            this.VSBaoCao[this.VSBaoCao.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(menuRight.Rows[num]["F002"]);
                            this.VSBaoCao[this.VSBaoCao.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(menuRight.Rows[num]["Ten"]);
                            if (menuRight.Rows[num]["F003"].ToString().Trim() == "0")
                            {
                                this.VSBaoCao[this.VSBaoCao.Rows.Count - 1, 2] = 0;
                            }
                            else
                            {
                                this.VSBaoCao[this.VSBaoCao.Rows.Count - 1, 2] = 1;
                            }
                        }
                    }
                    C1.Win.C1FlexGrid.C1FlexGrid vSChucNang = this.VSChucNang;
                    if (vSChucNang.Rows.Count > 0x19)
                    {
                        vSChucNang.Cols[1].Width = vSChucNang.Width - (((((vSChucNang.Cols[2].Width + vSChucNang.Cols[3].Width) + vSChucNang.Cols[4].Width) + vSChucNang.Cols[5].Width) + SystemInformation.VerticalScrollBarWidth) + 5);
                        this.CKXem.Left = 0x13d - SystemInformation.VerticalScrollBarWidth;
                        this.CKThem.Left = 0x16f - SystemInformation.VerticalScrollBarWidth;
                        this.CKSua.Left = 0x1a1 - SystemInformation.VerticalScrollBarWidth;
                        this.CKXoa.Left = 0x1d3 - SystemInformation.VerticalScrollBarWidth;
                    }
                    else
                    {
                        vSChucNang.Cols[1].Width = 0x127;
                        this.CKXem.Left = 0x13d;
                        this.CKThem.Left = 0x16f;
                        this.CKSua.Left = 0x1a1;
                        this.CKXoa.Left = 0x1d3;
                    }
                    vSChucNang = null;
                }
            }
        }

        public void LoadPhanHe()
        {
            DataTable phanHe = this.objNSD.GetPhanHe("");
            this.VSPhanHe.Rows.Count = 1;
            if (phanHe != null)
            {
                int num2 = phanHe.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    this.VSPhanHe.AddItem("");
                    this.VSPhanHe[this.VSPhanHe.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(phanHe.Rows[i]["Khoa"]);
                    this.VSPhanHe[this.VSPhanHe.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(phanHe.Rows[i]["Ten"]);
                }
                if (this.VSPhanHe.Rows.Count > 1)
                {
                    this.VSPhanHe.Select(1, 1);
                }
            }
        }

        public void SaveReportViewRight(int nRow, int nCol)
        {
            if (this.VSBaoCao.Rows.Count != 1)
            {
                string str;
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSBaoCao[nRow, 2])) != 0.0)
                {
                    str = "1";
                }
                else
                {
                    str = "0";
                }
                this.objNSD.SaveRight(modGeneral.MD5Encrypt(this.cFrmUserName), Conversions.ToString(this.VSBaoCao[nRow, 0]), str, "0", "0", "0");
            }
        }

        public void SaveRightPhatSinh(int nRow, int nCol)
        {
            string str;
            string str2;
            string str3;
            string str4;
            if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSChucNang[nRow, 2])) != 0.0)
            {
                str4 = "1";
            }
            else
            {
                str4 = "0";
            }
            if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSChucNang[nRow, 3])) != 0.0)
            {
                str = "1";
            }
            else
            {
                str = "0";
            }
            if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSChucNang[nRow, 4])) != 0.0)
            {
                str3 = "1";
            }
            else
            {
                str3 = "0";
            }
            if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSChucNang[nRow, 5])) != 0.0)
            {
                str2 = "1";
            }
            else
            {
                str2 = "0";
            }
            this.objNSD.SaveRight(modGeneral.MD5Encrypt(this.cFrmUserName), Conversions.ToString(this.VSChucNang[nRow, 0]), str4, str, str3, str2);
        }

        private void VSBaoCao_AfterEdit(object sender, RowColEventArgs e)
        {
            this.SaveReportViewRight(e.Row, e.Col);
        }

        private void VSChucNang_AfterEdit(object sender, RowColEventArgs e)
        {
            this.SaveRightPhatSinh(e.Row, e.Col);
        }

        private void VSPhanHe_RowColChange(object sender, EventArgs e)
        {
            if (this.IsLoaded)
            {
                this.LoadMenuRight();
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage3 = value;
            }
        }

        internal virtual CheckBox CKBaoCao
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKBaoCao;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKBaoCao_Click);
                if (this._CKBaoCao != null)
                {
                    this._CKBaoCao.Click -= handler;
                }
                this._CKBaoCao = value;
                if (this._CKBaoCao != null)
                {
                    this._CKBaoCao.Click += handler;
                }
            }
        }

        internal virtual CheckBox CKSua
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKSua;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKSua_Click);
                if (this._CKSua != null)
                {
                    this._CKSua.Click -= handler;
                }
                this._CKSua = value;
                if (this._CKSua != null)
                {
                    this._CKSua.Click += handler;
                }
            }
        }

        internal virtual CheckBox CKThem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKThem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKThem_CheckedChanged);
                if (this._CKThem != null)
                {
                    this._CKThem.CheckedChanged -= handler;
                }
                this._CKThem = value;
                if (this._CKThem != null)
                {
                    this._CKThem.CheckedChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKXem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKXem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKXem_Click);
                if (this._CKXem != null)
                {
                    this._CKXem.Click -= handler;
                }
                this._CKXem = value;
                if (this._CKXem != null)
                {
                    this._CKXem.Click += handler;
                }
            }
        }

        internal virtual CheckBox CKXoa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKXoa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKXoa_Click);
                if (this._CKXoa != null)
                {
                    this._CKXoa.Click -= handler;
                }
                this._CKXoa = value;
                if (this._CKXoa != null)
                {
                    this._CKXoa.Click += handler;
                }
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdCancel = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual TextBox TxtNhom
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNhom;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNhom = value;
            }
        }

        internal virtual TextBox TxtTenNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTenNhanVien = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSBaoCao
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSBaoCao;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSBaoCao_AfterEdit);
                if (this._VSBaoCao != null)
                {
                    this._VSBaoCao.AfterEdit -= handler;
                }
                this._VSBaoCao = value;
                if (this._VSBaoCao != null)
                {
                    this._VSBaoCao.AfterEdit += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSChucNang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSChucNang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSChucNang_AfterEdit);
                if (this._VSChucNang != null)
                {
                    this._VSChucNang.AfterEdit -= handler;
                }
                this._VSChucNang = value;
                if (this._VSChucNang != null)
                {
                    this._VSChucNang.AfterEdit += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSPhanHe
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSPhanHe;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.VSPhanHe_RowColChange);
                if (this._VSPhanHe != null)
                {
                    this._VSPhanHe.RowColChange -= handler;
                }
                this._VSPhanHe = value;
                if (this._VSPhanHe != null)
                {
                    this._VSPhanHe.RowColChange += handler;
                }
            }
        }
    }
}

